package com.ntu.rent.common.base;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

/**
 * 
 * 公司名称:上海天缘迪科<br/>
 * 工程名称:Rent<br/>
 * 包名:com.ntu.rent.common.base<br/>
 * 文件名:BaseAction.java<br/>
 * 功能描述:
 *
 *<br/>
 * 创建时间:2014-2-18 上午09:54:52<br/>
 * @author zeegates
 *
 */
public class BaseAction extends ActionSupport {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 系统运行日志.
	 */
	protected final Logger logger = Logger.getLogger(getClass());
	
	/**
	 * Convenience method to get the request.
	 * 
	 * @return current request
	 */
	protected HttpServletRequest getRequest() {
		return ServletActionContext.getRequest();
	}

	/**
	 * Convenience method to get the response.
	 * 
	 * @return current response
	 */
	protected HttpServletResponse getResponse() {
		return ServletActionContext.getResponse();
	}

	/**
	 * Convenience method to get the session.
	 * @return session
	 */
	protected HttpSession getSession() {
		return getRequest().getSession();
	}
}
